package skills.jssvc.deu.cn.skillsecond.util;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by Administrator on 2019/3/11 0011.
 */

public class SqlHelper extends SQLiteOpenHelper {

    public static String DA_NAME = "SecondSkill";
    public static String table_top = "toprecord";
    public static String ALLSENSE = "allsense";

    private String top="create table toprecord(" +
            "id integer primary key autoincrement," +
            "carId integer," +
            "amount integer," +
            "time text," +
            "user text)";
    private String allsense="create table allsense(" +
            "id integer primary key autoincrement," +
            "tem integer," +
            "hum integer," +
            "light integer," +
            "co2 integer," +
            "pm integer," +
            "roadState integer," +
            "time text)";

    public SqlHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        sqLiteDatabase.execSQL(top);
        sqLiteDatabase.execSQL(allsense);
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
